#include "StdAfx.h"
#include "Magnifier.h"
#include "ScrCaptureWnd.h"

CMagnifierUI::CMagnifierUI()
{

}

CMagnifierUI::~CMagnifierUI()
{

}

LPCTSTR CMagnifierUI::GetClass() const
{
    return DUI_CTR_MAGNIFIER;
}

LPVOID CMagnifierUI::GetInterface(LPCTSTR pstrName)
{
    if (_tcscmp(pstrName, DUI_CTR_MAGNIFIER) == 0) return static_cast<CMagnifierUI*>(this);
    return CControlUI::GetInterface(pstrName);
}

bool CMagnifierUI::DoPaint(HDC hDC, const RECT& rcPaint, CControlUI* pStopControl)
{
    RECT rcTemp = { 0 };
    if (!::IntersectRect(&rcTemp, &rcPaint, &m_rcItem)) return true;

    CRenderClip clip;
    CRenderClip::GenerateClip(hDC, rcTemp, clip);
    return CControlUI::DoPaint(hDC, rcPaint, pStopControl) && CScrCaptureWnd::GetInstance()->DrawMagnifier(hDC);
}
